<div class="topsection">
  <div class="toptxtsetion">eCommerce website packages, We only work with the best so it’s only fair to offer you the best, that’s why we use SagePay as our 100% trusted payment gateway.<br/>
    <img src="<?php echo $this->getSkinUrl()?>images/logo_03.jpg" alt="" /></div>
  	<div class="topadverts"> 
  	 <?php 
	//show the dynamic block
	$_block=Mage::getModel('cms/block')->load(2);
	echo $_block->getContent();
	?>
  </div>
  <div class="clearboth"></div>
</div>
<div class="maincontent">
<?php 
function subwords($words,$num){

	$total_num = str_word_count($words); 

	if($total_num <= $num){  
		return $words;
	}else{
		$pattern = '/([\S]+?[ ]+){'.$num.'}/';
		preg_match($pattern, $words, $out);
		return $out[0].'...'; 
	}
}

?>
<?php $posts = $this->getPosts(); ?>
<div class="title">
	<div class="turnpage">
		<?php $this->getPages(); ?>
	</div>
	<h1>NEWS</h1>
	<div class="clear"></div>
</div>

<div class="portfolioList">
	<?php foreach ($posts as $post): ?>
	<div class="portfolioListItems">
		<?php if($post->getNfile()):?>
		<a class="sphoto" href="<?php echo $post->getAddress(); ?>"><img src="<?php echo Mage::getBaseUrl('media').$post->getNfilethumb();?>"></a>
		<?php endif;?>
		<h3><a href="<?php echo $post->getAddress(); ?>"><?php echo $post->getTitle();?></a></h3>

		<div class="intro"><?php echo $post->getPostContent(); ?></div>
		<div class="clear"></div>
	</div>
	<?php endforeach; ?>
</div>
<div class="claerboth"></div>
</div>
